@extends('layout.index')
@section('title', '套餐修改')
@section('content')
<div class="mws-panel grid_8">
	
    <div class="mws-panel-body no-padding">
    	<form action="/admin/goods/packageupdate" method='post' class="mws-form " enctype="multipart/form-data">
    	@if (count($errors) >0)
    		<div class='mws-form-message error'>
    			添加失败!
    			<ul>
    				@foreach ($errors->all() as $error)
						<li>{{$error}}</li>
					@endforeach

    			</ul>
    		</div>

    	@endif
    		<div class="mws-panel grid_8">
                    <div class="mws-panel-header">
                        <span>商品套餐修改</span>
                    </div>
                    <div class="mws-panel-body no-padding">
                        <form action="form_layouts.html" class="mws-form">
                            <div class="mws-form-inline">
                                <div class="mws-form-row">
                                    <label class="mws-form-label">套餐名</label>
                                    <div class="mws-form-item">
                                        <input type="text" class="smallinfo" name='tname' value = "{{$packageinfo->tname}}">
                                    </div>
                                </div>
                                <div class="mws-form-row">
                                    <label class="mws-form-label">套餐原价</label>
                                    <div class="mws-form-item">
                                        <input type="text" class="smallinfo" name='yprice' value = "{{$packageinfo->yprice}}">
                                    </div>
                                </div>
                                <div class="mws-form-row">
                                    <label class="mws-form-label">套餐现价</label>
                                    <div class="mws-form-item">
                                        <input type="text" class="smallinfo" name='xprice' value = "{{$packageinfo->xprice}}">
                                    </div>
                                </div>

                                <div class="mws-form-row">
                                    <label class="mws-form-label">套餐原图片</label>
                                    <div class="mws-form-item" >
                                        <img src="{{$packageinfo->packageimage}}" alt="" width='100px'> 
                                    </div>
                                </div>

                                <div class="mws-form-row">
                                        <label class="mws-form-label">商品图片:</label>
                                        <div class="mws-form-item">
                                            <div style="position: relative;" class="fileinput-holder">
                                                <input name= "packageimage" type="file" style="position: absolute; top: 0px; right: 0px; margin: 0px; cursor: pointer; font-size: 999px; opacity: 0; z-index: 999;">
                                                
                                            </div>
                                        </div>
                                </div>
                            
                                
                              
                               <div class="mws-form-row">
                                 
                                    <label class="mws-form-label">套餐所属商品名</label>
                                    <div class="mws-form-item">
                                     
                                        <select class="smallinfo" name="sgsid">
                                        @foreach($goods as $k=>$v)
                                            <option value ="{{$v->id}}" 
                                            @if($packageinfo->sgsid == $v->id)
                                            selected
                                            @endif
                                            >{{$v->proname}}</option>
                                           @endforeach
                                        </select>

                                         
                                    </div>
                                </div>
                               
                               
                            
                            
                            {{csrf_field()}}
                            <div class="mws-button-row">

                                <input type="submit" class="btn btn-danger" value='修改'>
                                <input type="reset" class="btn " value="重置">
                            </div>
                        </form>
                    </div>      
                </div>
               
@endsection



